ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Roe_Base Class Reference

#include <Roe_all.h>

Inheritance diagram for Roe_Base:
TAnimal TALMaSSObject Roe_Adult_Base Roe_Fawn Roe_Female Roe_Male

Public Member Functions

unsigned IsAlive ()
 
int SupplyReserves ()
 
virtual void On_MumAbandon (Roe_Female *)
 
virtual void On_IsDead (Roe_Base *, int, bool)
 
virtual void On_EndGroup ()
 
virtual void Send_IsDead ()
 
virtual void On_ChangeGroup (int)
 
virtual void On_UpdateGroup (int, int)
 
RoeDeerInfo SupplyInfo ()
 
virtual void BeginStep (void)
 BeingStep behaviour - must be implemented in descendent classes. More...
 
virtual void Step (void)
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void EndStep (void)
 EndStep behaviour - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
 Roe_Base (int x, int y, Landscape *L, RoeDeer_Population_Manager *RPM)
 
virtual ~Roe_Base ()
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Public Attributes

TRoeDeerStates CurrentRState
 
RoeDeer_Population_Managerm_OurPopulation
 
int m_Age
 
int m_Size
 
int m_RangeCentre_x
 
int m_RangeCentre_y
 
int m_Reserves
 
double m_HomeRange
 
int m_OldRange_x
 
int m_OldRange_y
 
int m_SearchRange
 
bool m_float
 
bool m_Disperse
 
bool m_HaveRange
 
Roe_FemaleMum
 
int m_ID
 
int m_FixlistNumber
 
bool m_Sex
 
bool m_IsDead
 
unsigned Alive
 

Protected Member Functions

bool Running (int x, int y)
 
void Ignore (int p_To_x, int p_To_y)
 
int DistanceTo (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DistanceToCC (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DirectionTo (int p_x, int p_y, int p_To_x, int p_To_y)
 
int DirectionToCC (int p_x, int p_y, int p_To_x, int p_To_y)
 
int NextStep (int weight, int dir, int recurselevel)
 
int AssessHabitat (int polyref)
 
int AssessHabitat (int p_x, int p_y)
 
int LegalHabitat (int p_x, int p_y)
 
int LegalHabitatCC (int p_x, int p_y)
 
int Cover (int polyref)
 Calls the cover calculation for a given polyref. More...
 
int Cover (int p_x, int p_y)
 Calls the cover calculation for a given x,y location. More...
 
int CalcCover (TTypesOfLandscapeElement a_ele, int a_poly)
 The cover calculation for a given element type. More...
 
int CoverCC (int p_x, int p_y)
 
int NutriValue (int polyref)
 
int NutriValue (int p_x, int p_y)
 
int NutriValueCC (int p_x, int p_y)
 
int Feeding (bool p_Disperse)
 
void SeekCover (int threshold)
 
void SeekNutri (int p_threshold)
 
int ProbRoadCross (int p_x, int p_y, int p_width)
 
double CalculateRoadMortality (int p_x, int p_y, int p_width)
 
void WalkTo (int pos_x, int pos_y)
 
void WalkToCC (int pos_x, int pos_y)
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int timestep
 
int m_Cross_x
 
int m_Cross_y
 
double m_EnergyGained
 
int m_RecovCount
 
int m_RumiCount
 
int m_FeedCount
 
int m_LengthFeedPeriod
 
int m_LengthRuminate
 
int m_LastState
 
int m_danger_x
 
int m_danger_y
 
int m_distrc
 
int m_weightedstep
 
int SimW
 
int SimH
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Constructor & Destructor Documentation

◆ Roe_Base()

Roe_Base::Roe_Base ( int  x,
int  y,
Landscape L,
RoeDeer_Population_Manager RPM 
)

Roe_Base::Roe_Base - constructor for Roe base. Sets all attributes

1626  :TAnimal(x,y,L)
1627 {
1628  m_Location_x=x;
1629  m_Location_y=y;
1630  m_RangeCentre_x=x;
1631  m_RangeCentre_y=y;
1632  m_HomeRange=0;
1633  m_HaveRange=false;
1634  m_OldRange_x=x;
1635  m_OldRange_y=y;
1636  m_danger_x=0;
1637  m_danger_y=0;
1638  m_Disperse = false;
1639  m_float=false;
1640  m_OurLandscape=L;
1641  m_OurPopulation=RPM;
1642  m_FixlistNumber = -1; //not set yet
1645  m_Cross_x=x;
1646  m_Cross_y=y;
1648  timestep=0;
1649  m_RumiCount=0;
1650  m_FeedCount=0;
1651  m_RecovCount=0;
1652  m_weightedstep=0;
1653  m_EnergyGained=0;
1654  m_LengthFeedPeriod = 3; //in timesteps, just the first day, updated daily in UpdateEnergy
1655  m_LengthRuminate = 0; //set every time roe finishes a feeding period
1656  Alive=0x0DEADC0DE;
1657 }
@ rds_Initialise
Definition: Roe_all.h:46
bool m_float
Definition: Roe_all.h:114
int m_RangeCentre_y
Definition: Roe_all.h:108
int m_FixlistNumber
Definition: Roe_all.h:119
unsigned Alive
Definition: Roe_all.h:122
int m_LengthFeedPeriod
Definition: Roe_all.h:136
int m_OldRange_y
Definition: Roe_all.h:112
int m_OldRange_x
Definition: Roe_all.h:111
int SimH
Definition: Roe_all.h:145
int SimW
Definition: Roe_all.h:144
RoeDeer_Population_Manager * m_OurPopulation
Definition: Roe_all.h:104
bool m_Disperse
Definition: Roe_all.h:115
int m_RecovCount
Definition: Roe_all.h:133
int m_Cross_x
Definition: Roe_all.h:130
int timestep
Definition: Roe_all.h:128
int m_Cross_y
Definition: Roe_all.h:131
int m_RangeCentre_x
Definition: Roe_all.h:107
bool m_HaveRange
Definition: Roe_all.h:116
int m_FeedCount
Definition: Roe_all.h:135
int m_danger_x
Definition: Roe_all.h:139
int m_danger_y
Definition: Roe_all.h:140
int m_RumiCount
Definition: Roe_all.h:134
int m_weightedstep
Definition: Roe_all.h:143
double m_HomeRange
Definition: Roe_all.h:110
double m_EnergyGained
Definition: Roe_all.h:132
int m_LengthRuminate
Definition: Roe_all.h:137
TRoeDeerStates CurrentRState
Definition: Roe_all.h:103
int SimH
Definition: Roe_all.h:530
int SimW
Definition: Roe_all.h:529
int m_Location_y
Definition: PopulationManager.h:228
TAnimal(int x, int y, Landscape *L)
Definition: PopulationManager.cpp:1367
int m_Location_x
Definition: PopulationManager.h:225
Landscape * m_OurLandscape
Definition: PopulationManager.h:229

References Alive, CurrentRState, m_Cross_x, m_Cross_y, m_danger_x, m_danger_y, m_Disperse, m_EnergyGained, m_FeedCount, m_FixlistNumber, m_float, m_HaveRange, m_HomeRange, m_LengthFeedPeriod, m_LengthRuminate, TAnimal::m_Location_x, TAnimal::m_Location_y, m_OldRange_x, m_OldRange_y, TAnimal::m_OurLandscape, m_OurPopulation, m_RangeCentre_x, m_RangeCentre_y, m_RecovCount, m_RumiCount, m_weightedstep, rds_Initialise, SimH, RoeDeer_Population_Manager::SimH, SimW, RoeDeer_Population_Manager::SimW, and timestep.

◆ ~Roe_Base()

Roe_Base::~Roe_Base ( )
virtual
1660 {
1661  Alive=0;
1662 }

References Alive.

Member Function Documentation

◆ AssessHabitat() [1/2]

int Roe_Base::AssessHabitat ( int  p_x,
int  p_y 
)
protected

◆ AssessHabitat() [2/2]

int Roe_Base::AssessHabitat ( int  polyref)
protected

◆ BeginStep()

void Roe_Base::BeginStep ( void  )
virtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from TAnimal.

Reimplemented in Roe_Male, Roe_Female, Roe_Fawn, and Roe_Adult_Base.

18 {
19  if (m_CurrentStateNo==-1) return;
20 }
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References TALMaSSObject::m_CurrentStateNo.

◆ CalcCover()

int Roe_Base::CalcCover ( TTypesOfLandscapeElement  a_ele,
int  a_poly 
)
protected

The cover calculation for a given element type.

Each type of habitat is given a relative cover value for an adult roe from 0-4. Non-habitat is given a value of -1. Openland with very low veg = 0. Related to VegHeight and type of veg. In open land all that matters is VegHeight

Todo:
Decide on classification for new tole types for roe deer 3
956 {
964  int cov;
965  int height;
966  char errornum[20];
967  switch(a_ele)
968  {
969  case tole_BareRock:
970  case tole_UrbanNoVeg:
971  case tole_UrbanPark:
972  case tole_SandDune:
973  case tole_Churchyard: //204
975  case tole_Carpark:
976  case tole_Building:
977  case tole_Garden:
978  case tole_Saltwater:
979  case tole_Pond:
980  case tole_Freshwater:
981  case tole_River:
982  case tole_Coast:
983  case tole_ActivePit:
984  case tole_Railway:
985  case tole_HeritageSite:
986  case tole_Stream:
987  cov=-2;
988  break;
989 
990  case tole_RoadsideVerge:
991  case tole_StoneWall:
992  case tole_Fence:
993  case tole_RoadsideSlope:
994  cov=0;
995  break;
996 
997  case tole_NaturalGrassDry: // 110
998  case tole_NaturalGrassWet: // 110
999  case tole_MownGrass: // 58
1000  case tole_OrchardBand: // 57
1001  case tole_Saltmarsh: // 95
1002  case tole_Heath:
1003  case tole_AmenityGrass:
1004  case tole_PermPasture:
1007  case tole_Marsh:
1008  case tole_Field:
1010  cov = 1 + (int)floor(m_OurLandscape->SupplyVegHeight(a_poly)*0.02);
1011  if ( cov > 4 )
1012  cov = 4;
1013  break;
1014  case tole_DeciduousForest:
1015  case tole_ConiferousForest:
1016  case tole_MixedForest:
1017  case tole_Copse:
1018  case tole_IndividualTree:
1019  height = m_OurLandscape->SupplyTreeHeight(a_poly);
1020  if(height<=10) cov = 3;
1021  else cov = 2;
1022  break;
1023 
1024  case tole_YoungForest: //new class 55
1025  case tole_Scrub:
1026  case tole_PitDisused:
1027  case tole_RiversideTrees:
1028  case tole_HedgeBank: // added by ljk 13/7/2012
1029  case tole_Hedges:
1030 
1031  cov=3;
1032  break;
1033 
1034  case tole_RiversidePlants:
1035  case tole_FieldBoundary:
1036  if (m_OurLandscape->SupplyVegHeight(a_poly)<100) cov = 2;
1037  else cov=3;
1038  break;
1039 
1040  case tole_LargeRoad:
1041  case tole_SmallRoad:
1042  case tole_Track:
1043  cov=-1; //need to distingues roads from other non-habitats
1044  break;
1045 
1046  case tole_Foobar:
1047  sprintf(errornum, "%d", a_ele);
1048  m_OurLandscape->Warn("Roe_Base::Cover(): Unknown element type!",
1049  errornum);
1050  exit( 1 );
1051  break;
1053  case tole_PlantNursery:
1054  case tole_Vildtager:
1055  case tole_WindTurbine:
1056  case tole_WoodyEnergyCrop:
1057  case tole_WoodlandMargin:
1058  case tole_Pylon:
1059  default:
1060  //throw an error
1061  sprintf(errornum, "%d", a_ele);
1062  m_OurLandscape->Warn("Roe_Base::Cover(): Unknown element type!",
1063  errornum);
1064  exit( 1 );
1065  break;
1066  }
1067  return cov;
1068 }
int SupplyTreeHeight(int, int)
Definition: landscape.h:814
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:936
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
@ tole_BareRock
Definition: tole_declaration.h:75
@ tole_PermPastureTussocky
Definition: tole_declaration.h:45
@ tole_Saltmarsh
Definition: tole_declaration.h:88
@ tole_WoodyEnergyCrop
Definition: tole_declaration.h:94
@ tole_Carpark
Definition: tole_declaration.h:85
@ tole_Coast
Definition: tole_declaration.h:67
@ tole_UrbanNoVeg
Definition: tole_declaration.h:78
@ tole_Stream
Definition: tole_declaration.h:89
@ tole_Saltwater
Definition: tole_declaration.h:66
@ tole_MixedForest
Definition: tole_declaration.h:53
@ tole_HeritageSite
Definition: tole_declaration.h:90
@ tole_WoodlandMargin
Definition: tole_declaration.h:98
@ tole_RoadsideSlope
Definition: tole_declaration.h:83
@ tole_River
Definition: tole_declaration.h:65
@ tole_StoneWall
Definition: tole_declaration.h:56
@ tole_NaturalGrassWet
Definition: tole_declaration.h:87
@ tole_NaturalGrassDry
Definition: tole_declaration.h:48
@ tole_UrbanPark
Definition: tole_declaration.h:79
@ tole_Pylon
Definition: tole_declaration.h:96
@ tole_PermanentSetaside
Definition: tole_declaration.h:46
@ tole_Garden
Definition: tole_declaration.h:58
@ tole_Pond
Definition: tole_declaration.h:101
@ tole_Scrub
Definition: tole_declaration.h:42
@ tole_Fence
Definition: tole_declaration.h:57
@ tole_Field
Definition: tole_declaration.h:43
@ tole_Copse
Definition: tole_declaration.h:82
@ tole_PermPasture
Definition: tole_declaration.h:47
@ tole_Hedges
Definition: tole_declaration.h:37
@ tole_Track
Definition: tole_declaration.h:59
@ tole_Heath
Definition: tole_declaration.h:70
@ tole_Freshwater
Definition: tole_declaration.h:64
@ tole_PitDisused
Definition: tole_declaration.h:50
@ tole_FieldBoundary
Definition: tole_declaration.h:40
@ tole_PlantNursery
Definition: tole_declaration.h:95
@ tole_DeciduousForest
Definition: tole_declaration.h:52
@ tole_ActivePit
Definition: tole_declaration.h:63
@ tole_RiversidePlants
Definition: tole_declaration.h:49
@ tole_Building
Definition: tole_declaration.h:62
@ tole_RoadsideVerge
Definition: tole_declaration.h:38
@ tole_Vildtager
Definition: tole_declaration.h:99
@ tole_MownGrass
Definition: tole_declaration.h:74
@ tole_YoungForest
Definition: tole_declaration.h:55
@ tole_OrchardBand
Definition: tole_declaration.h:73
@ tole_SmallRoad
Definition: tole_declaration.h:60
@ tole_Churchyard
Definition: tole_declaration.h:86
@ tole_BuiltUpWithParkland
Definition: tole_declaration.h:80
@ tole_AmenityGrass
Definition: tole_declaration.h:76
@ tole_PermPastureLowYield
Definition: tole_declaration.h:44
@ tole_HedgeBank
Definition: tole_declaration.h:68
@ tole_Railway
Definition: tole_declaration.h:39
@ tole_WindTurbine
Definition: tole_declaration.h:97
@ tole_ConiferousForest
Definition: tole_declaration.h:54
@ tole_SandDune
Definition: tole_declaration.h:81
@ tole_IndividualTree
Definition: tole_declaration.h:93
@ tole_Foobar
Definition: tole_declaration.h:111
@ tole_RiversideTrees
Definition: tole_declaration.h:51
@ tole_LargeRoad
Definition: tole_declaration.h:61
@ tole_Marsh
Definition: tole_declaration.h:41

References TAnimal::m_OurLandscape, Landscape::SupplyTreeHeight(), Landscape::SupplyVegHeight(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Foobar, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_OrchardBand, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, and Landscape::Warn().

Referenced by Cover().

◆ CalculateRoadMortality()

double Roe_Base::CalculateRoadMortality ( int  p_x,
int  p_y,
int  p_width 
)
protected

Roe_Base::CalculateRoadMortality - calculates the mortality probability of crossing a road, depending on traffic load, probability of car passing as roe deer is passing, given this - probability of roe deer getting hit. Calls function SupplyTrafficLoad().

1094 {
1095  //get trafficload
1096  double traffic=(double) m_OurLandscape->SupplyTrafficLoad(p_x,p_y); //cars/hr
1097  //prob of a car passing while roe is crossing
1098  double cars =((double)traffic/1200); //cars/3 sec
1099  int rand = random(100);
1100  if ((double)rand<((double)cars*100)) //a car is passing, so calculate roes prob of getting hit
1101  {
1102  //Every cars that passes while roe is crossing is only lethal on half the
1103  //roadwidth. Lethalwidth is thus=0.5*p_width.
1104  //Prob of getting killed is 1-(1-(lethalwidth/p_width))^lethalcars.
1105  //Lethalwidth/p_width=0.5, so inner brackets=0.5
1106  //The prob. of getting killed is thus 1-(0.5^cars)
1107  return (double) (100*(1-pow(double(0.5),cars)));
1108  }
1109  else return 0; //no car passing
1110 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
double SupplyTrafficLoad(int a_x, int a_y)
Definition: landscape.h:1293

References TAnimal::m_OurLandscape, random(), and Landscape::SupplyTrafficLoad().

Referenced by NextStep(), Running(), Roe_Fawn::RunTo(), and WalkTo().

◆ Cover() [1/2]

int Roe_Base::Cover ( int  p_x,
int  p_y 
)
protected

Calls the cover calculation for a given x,y location.

950 {
952 }
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
int CalcCover(TTypesOfLandscapeElement a_ele, int a_poly)
The cover calculation for a given element type.
Definition: Roe_base.cpp:955

References CalcCover(), TAnimal::m_OurLandscape, Landscape::SupplyElementType(), and Landscape::SupplyPolyRef().

◆ Cover() [2/2]

int Roe_Base::Cover ( int  a_polyref)
protected

Calls the cover calculation for a given polyref.

Roe_Base::Cover - Input coordinates. Each type of habitat is given a relative cover value for an adult roe deer from 0-4. Non-habitat is given a value of -1. Open land with very low veg = 0. Related to VegHeight and type of vegetation. In open land all that matters is VegHeight. Returns cover value. Calls functions SupplyElementType(), SupplyVegHeight() and SupplyTreeHeight().

944 {
945  return CalcCover(m_OurLandscape->SupplyElementType(a_polyref), a_polyref);
946 }

References CalcCover(), TAnimal::m_OurLandscape, and Landscape::SupplyElementType().

Referenced by Roe_Fawn::FARuminate(), Roe_Female::FRuminate(), Roe_Male::MRuminate(), Roe_Female::On_ApproachOfDanger(), Roe_Male::On_ApproachOfDanger(), Running(), and SeekCover().

◆ CoverCC()

int Roe_Base::CoverCC ( int  p_x,
int  p_y 
)
inlineprotected

corrects coordinates (for cover) for wrap around landscape

189  {
190  m_OurLandscape->CorrectCoords( p_x, p_y );
191  return Cover( p_x, p_y );
192  }
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1535
int Cover(int polyref)
Calls the cover calculation for a given polyref.
Definition: Roe_base.cpp:943

Referenced by SeekCover().

◆ DirectionTo()

int Roe_Base::DirectionTo ( int  p_x,
int  p_y,
int  p_To_x,
int  p_To_y 
)
protected

Roe_Base::DirectionTo - calculates direction to a specific location

804 {
805  double a = double(p_x-p_To_x);
806  double b = double(p_y-p_To_y);
807  int thisway=0;
808 
809  if ((b>SimH/2)||(b*-1>SimH/2))
810  {
811  b=b*-1;
812  }
813  if((a>SimW/2)||(a*-1>SimW/2))
814  {
815  a=a*-1;
816  }
817  if (a > 0)
818  {
819  if (b>0) thisway=7;
820  else if (b<0)
821  {
822  thisway=5;
823  }
824  else thisway=6; //b=0
825  }
826  else if (a < 0)
827  {
828  if (b>0) thisway=1;
829  else if (b<0) thisway=3;
830  else thisway=2;
831  }
832  else if (a==0)
833  {
834  if (b>0) thisway=0;
835  else thisway=4;
836  }
837  return thisway;
838 }

References SimH, and SimW.

Referenced by Roe_Fawn::FAFeed(), Roe_Female::FDisperse(), Feeding(), Roe_Female::FEvade(), Roe_Male::MDisperse(), Roe_Male::MEvade(), Running(), Roe_Fawn::RunTo(), and WalkTo().

◆ DirectionToCC()

int Roe_Base::DirectionToCC ( int  p_x,
int  p_y,
int  p_To_x,
int  p_To_y 
)
inlineprotected
159  {
160  m_OurLandscape->CorrectCoords( p_x, p_y );
161  return DirectionTo( p_x, p_y, p_To_x, p_To_y );
162  }
int DirectionTo(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_base.cpp:802

Referenced by WalkTo().

◆ DistanceTo()

int Roe_Base::DistanceTo ( int  p_x,
int  p_y,
int  p_To_x,
int  p_To_y 
)
protected

Roe_Base::DistanceTo - calculates distance from 2 coordinates to other 2 coordinates.

785 {
786  int x = (p_x - p_To_x);
787  int y = (p_y - p_To_y);
788  if(x<0) x = x * -1;
789  if (y<0) y = y * -1;
790  if (x > (SimW/2)) x = SimW - x;
791  if (y > (SimH/2)) y = SimH - y;
792  if ((x!=0)||(y!=0))
793  {
794  return (int)(sqrt(double ((x*x) + (y*y))));
795  }
796  else return 0; // in the case where roe is standing on p_To_x,p_To_y
797 }

References SimH, and SimW.

Referenced by Roe_Male::BeginStep(), Roe_Fawn::FAFeed(), Roe_Fawn::FASuckle(), Feeding(), Roe_Female::FEstablishRange(), Roe_Female::FOnNewDay(), Roe_Male::MOnNewDay(), Roe_Fawn::On_ApproachOfDanger(), Roe_Female::On_ApproachOfDanger(), Roe_Male::On_ApproachOfDanger(), Roe_Male::On_InHeat(), Roe_Male::On_Rank(), Roe_Fawn::RunTo(), Roe_Fawn::SelectBedSite(), and WalkTo().

◆ DistanceToCC()

int Roe_Base::DistanceToCC ( int  p_x,
int  p_y,
int  p_To_x,
int  p_To_y 
)
inlineprotected
151  {
152  m_OurLandscape->CorrectCoords( p_x, p_y );
153  m_OurLandscape->CorrectCoords( p_To_x, p_To_y );
154  return DistanceTo( p_x, p_y, p_To_x, p_To_y );
155  }
int DistanceTo(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_base.cpp:784

Referenced by Roe_Female::FEstablishRange(), and WalkTo().

◆ EndStep()

void Roe_Base::EndStep ( void  )
virtual

EndStep behaviour - must be implemented in descendent classes.

Reimplemented from TAnimal.

Reimplemented in Roe_Male, Roe_Female, Roe_Fawn, and Roe_Adult_Base.

32 {
33  if (m_StepDone || (m_CurrentStateNo==-1)) return;
34 }
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118

References TALMaSSObject::m_CurrentStateNo, and TALMaSSObject::m_StepDone.

◆ Feeding()

int Roe_Base::Feeding ( bool  p_Disperse)
protected

Roe_Base::Feeding - When habitat has been deemed suitable for feeding, next step is to evaluate whether steps should be weighted towards range centre or not. To avoid that animals gets trapped when using very directed walk, their progress during the last hour (6 timesteps) is monitored. Calls DistanceTo(), NextStep().

738 {
739  //Habitat is suitable for feeding. Now evaluate whether steps should be
740  //weighted towards range centre or not
741 
742  int weight;
743  int dir;
744  int distrc;
745 
746  //first get distance and direction back to range centre
749 
750  //to avoid that animals gets trapped when using very directed walk, keep track
751  //of their progress during the last hour (6 timesteps)
752  if ((m_weightedstep>5)&&(m_distrc-distrc<50))
753  { //must be stuck so take the next steps without weight
754  weight=0;
755  }
756  else
757  {
758  if ((p_Disperse==true)||(distrc<=m_SearchRange)) //don't worry about rangecentre
759  {
760  weight=0;
761  m_weightedstep=0;
762  }
763  else
764  {
765  if(distrc<=m_SearchRange+100) weight=1;
766  else if ((distrc>m_SearchRange+100)&&(distrc<=m_SearchRange+200)) weight=2;
767  else if (distrc>m_SearchRange+200) weight=3;
768  m_weightedstep++;
769  m_distrc = distrc;
770  }
771  }
772 
773  //take the steps
774  if (NextStep(weight,dir,0)==-1) // roe has taken a step and died doing it
775  {
776  m_IsDead=true;
777  }
778  return 0;
779 }
int m_distrc
Definition: Roe_all.h:142
bool m_IsDead
Definition: Roe_all.h:121
int m_SearchRange
Definition: Roe_all.h:113
int NextStep(int weight, int dir, int recurselevel)
Definition: Roe_base.cpp:1242

References DirectionTo(), DistanceTo(), m_distrc, m_IsDead, TAnimal::m_Location_x, TAnimal::m_Location_y, m_RangeCentre_x, m_RangeCentre_y, m_SearchRange, m_weightedstep, and NextStep().

Referenced by Roe_Female::FFeed(), and Roe_Male::MFeed().

◆ Ignore()

void Roe_Base::Ignore ( int  p_To_x,
int  p_To_y 
)
protected

◆ IsAlive()

unsigned Roe_Base::IsAlive ( )
inline
123 {return Alive;}

Referenced by Roe_Male::AddSatellite(), RoeDeer_Population_Manager::AddToFightlist(), RoeDeer_Population_Manager::AddToGroup(), Roe_Fawn::BeginStep(), Roe_Female::BeginStep(), Roe_Male::BeginStep(), RoeDeer_Population_Manager::CreateNewGroup(), RoeDeer_Population_Manager::DoFirst(), Roe_Fawn::EndStep(), Roe_Female::EndStep(), Roe_Male::EndStep(), Roe_Fawn::FADie(), Roe_Fawn::FAFeed(), Roe_Fawn::FAHide(), Roe_Fawn::FAInit(), Roe_Fawn::FAOnNewDay(), Roe_Fawn::FARecover(), Roe_Fawn::FARuminate(), Roe_Fawn::FARunToMother(), Roe_Fawn::FASuckle(), Roe_Fawn::FAUpdateEnergy(), Roe_Female::FCareForYoung(), Roe_Female::FDie(), Roe_Female::FDisperse(), Roe_Female::FEstablishRange(), Roe_Female::FEvade(), Roe_Female::FFeed(), Roe_Female::FFormGroup(), Roe_Female::FGiveBirth(), Roe_Female::FIgnore(), Roe_Female::FInHeat(), Roe_Female::FMate(), Roe_Female::FOnMature(), Roe_Female::FOnNewDay(), Roe_Female::FRecover(), Roe_Female::FRuminate(), Roe_Female::FRun(), Roe_Female::FUpdateEnergy(), Roe_Female::FUpdateGestation(), Roe_Male::MAttendFemale(), Roe_Male::MDie(), Roe_Male::MDisperse(), Roe_Male::MEstablishRange(), Roe_Male::MEstablishTerritory(), Roe_Male::MEvade(), Roe_Male::MFeed(), Roe_Male::MFight(), Roe_Male::MIgnore(), Roe_Male::MMate(), Roe_Male::MOnMature(), Roe_Male::MOnNewDay(), Roe_Male::MRecover(), Roe_Male::MRuminate(), Roe_Male::MRun(), Roe_Male::MUpdateEnergy(), NextStep(), Roe_Male::On_Expelled(), Roe_Male::On_InHeat(), Roe_Fawn::On_IsDead(), Roe_Female::On_IsDead(), Roe_Male::On_IsDead(), Roe_Male::On_NewHost(), RoeDeer_Population_Manager::RemoveFromFightlist(), RoeDeer_Population_Manager::RemoveFromGroup(), Roe_Male::RemoveSatellite(), Roe_Female::Roe_Female(), Roe_Male::Roe_Male(), Roe_Female::Send_EndGroup(), Roe_Fawn::Step(), Roe_Female::Step(), and Roe_Male::Step().

◆ LegalHabitat()

int Roe_Base::LegalHabitat ( int  p_x,
int  p_y 
)
protected

Roe_Base::LegalHabitat - returns a value indicating whether element type can be crossed or not. -1: lethal, cannot be crossed, 0: roads, needs evaluation, 1: can be crossed

Todo:
Decide on classification for new tole types for roe deer 2
848 {
849  //returns a value indicating whether element type can be crossed or not.
850  //-1: lethal, cannot be crossed, 0: roads, needs evaluation, 1: can be crossed
852  int value;
853  switch(Elem)
854  {
855  case tole_Building:
856  case tole_Garden:
857  case tole_StoneWall:
858  case tole_Fence:
859  case tole_Saltwater:
860  case tole_Pond:
861  case tole_Freshwater:
862  case tole_River:
863  case tole_Stream:
864  case tole_ActivePit:
865  case tole_UrbanNoVeg:
866  case tole_Churchyard: //204
868  case tole_Carpark:
869  case tole_RoadsideSlope:
870  case tole_BareRock:
871  value = -1;
872  break;
873 
874  case tole_Field:
875  case tole_RoadsideVerge:
876  case tole_PermPasture:
881  case tole_MixedForest:
882  case tole_YoungForest: //new class 55
883  case tole_Copse:
884  case tole_Scrub:
885  case tole_PitDisused:
886  case tole_RiversideTrees:
890  case tole_Coast:
892  case tole_Railway:
893  case tole_Track:
894  case tole_Hedges:
895  case tole_HedgeBank:
896  case tole_FieldBoundary:
897  case tole_Marsh:
898  case tole_MownGrass: // 58
899  case tole_OrchardBand: // 57
900  case tole_Orchard: //56
901  case tole_Saltmarsh: // 95
902  case tole_Heath:
903  case tole_AmenityGrass:
904  case tole_UrbanPark:
905  case tole_SandDune:
906  case tole_HeritageSite:
907  value = 1;
908  break;
909 
910  case tole_LargeRoad:
911  case tole_SmallRoad:
912  value=0;
913  break;
914 
915  case tole_Foobar:
916  m_OurLandscape->Warn("Roe_Base::LegalHabitat(): Unknown element type!", g_landscape_p->PolytypeToString(Elem));
917  exit( 1 );
918  break;
920  case tole_IndividualTree:
921  case tole_PlantNursery:
922  case tole_Vildtager:
923  case tole_WindTurbine:
925  case tole_WoodlandMargin:
926  case tole_Pylon:
927  default:
928  //throw an error
929  m_OurLandscape->Warn("Roe_Base::LegalHabitat(): Unknown element type!", g_landscape_p->PolytypeToString(Elem));
930  exit( 1 );
931  break;
932  }
933  return value;
934 }
std::string PolytypeToString(TTypesOfLandscapeElement a_le_type)
Definition: Landscape.cpp:4087
class Landscape * g_landscape_p
Definition: Landscape.cpp:258
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
@ tole_Orchard
Definition: tole_declaration.h:71

References g_landscape_p, TAnimal::m_OurLandscape, Landscape::PolytypeToString(), Landscape::SupplyElementType(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Foobar, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, and Landscape::Warn().

Referenced by Roe_Female::FEstablishRange(), and NextStep().

◆ LegalHabitatCC()

int Roe_Base::LegalHabitatCC ( int  p_x,
int  p_y 
)
inlineprotected

LegalHabitatCC -calls LegalHabitat witth coordinates corrected for wrap-around

173  {
174  m_OurLandscape->CorrectCoords( p_x, p_y );
175  return LegalHabitat( p_x, p_y );
176  }
int LegalHabitat(int p_x, int p_y)
Definition: Roe_base.cpp:847

Referenced by Roe_Female::FEstablishRange(), NextStep(), and WalkTo().

◆ NextStep()

int Roe_Base::NextStep ( int  weight,
int  dir,
int  recurselevel 
)
protected

Roe_Base::NextStep - This function makes the animal object perform a semirandom walk choosing best feeding habitat based on cover and nutri.value one step at a time. Equals 10 minutes of activity. Calls functions LegalHabitatCC(), SupplyElementType(), SupplyRoadWidth(), ProbRoadCross(), CalculateRoadMortality(), LegalHabitat(), SupplyPolyRef(),CorrectWidth(), CorrectHeight(), SuplyPolyRefCC().

1243 {
1244  // **FN** Tunet 15/6-2001.
1245 
1246  #ifdef JUJ__Debug3
1247  if(IsAlive()!=0x0DEADC0DE)
1248  {
1249  m_OurLandscape ->Warn("Roe_Base:NextStep():Deadcode warning","");
1250  exit( 1 );
1251  }
1252  #endif
1253  //semirandom walk choosing best feeding habitat based on cover and nutri.value
1254  //One step at a time. Equals 10 minutes of activity
1255  if(recurselevel>2)
1256  {
1257  m_OurLandscape ->Warn("Roe_Base:NextStep():Variable out of range, recurselevel","");
1258  exit( 1 );
1259  }
1260 
1261  int t[8];
1262  t[0] = dir;
1263  t[1] = (dir+ 9) & 7;
1264  t[2] = (dir+ 7) & 7;
1265  t[3] = (dir+ 10) & 7;
1266  t[4] = (dir + 6) & 7;
1267  t[5] = (dir+ 11) & 7;
1268  t[6] = (dir + 5) & 7;
1269  t[7] = (dir + 12) & 7;
1270  int q[8]= {0};
1271  int x = m_Location_x;
1272  int y = m_Location_y;
1273  bool found=false;
1274  bool correct=false;
1275  int step=0;
1276  int check=-2;
1277  int index[8]= {0};
1278  int best=-1;
1279  int score = -1;
1280  int thissquare;
1281  int d[5]={8,7,5,3,1};
1282 
1283  //check whether you step out of area. If so use % Sim, else not
1284  if((x <= 200)||(x >= SimW-200)||(y <= 200)||(y >= SimH-200)) //next step could take you out of area
1285  {
1286  x += SimW;
1287  y += SimH;
1288  correct=true;
1289  }
1290  if(correct==true)
1291  {
1292  //take 50 steps
1293  for(int i=0;i<50;i++)
1294  {
1295  q[0] = LegalHabitatCC( x+Vector_x[t[0]], y+Vector_y[t[0]] );
1296  q[1] = LegalHabitatCC( x+Vector_x[t[1]], y+Vector_y[t[1]] );
1297  q[2] = LegalHabitatCC( x+Vector_x[t[2]], y+Vector_y[t[2]] );
1298  q[3] = LegalHabitatCC( x+Vector_x[t[3]], y+Vector_y[t[3]] );
1299  q[4] = LegalHabitatCC( x+Vector_x[t[4]], y+Vector_y[t[4]] );
1300  q[5] = LegalHabitatCC( x+Vector_x[t[5]], y+Vector_y[t[5]] );
1301  q[6] = LegalHabitatCC( x+Vector_x[t[6]], y+Vector_y[t[6]] );
1302  q[7] = LegalHabitatCC( x+Vector_x[t[7]], y+Vector_y[t[7]] );
1303  //q[i]=-1,non-habitat, q[i]=0,road, q[i]=1 suitable
1304 
1305  for (int j=0; j<d[weight]; j++) //score as many squares as needed
1306  {
1307  if (q[j]>=0) //scores all suitable and finds the best square
1308  {
1309  score++;
1310  index[score]=j;
1311  }
1312  }
1313  if (score==-1) //no suitable options,
1314  {
1315  if((recurselevel==2)||(NextStep(0,dir,++recurselevel)==-1))
1316  {
1317  return -1;
1318  }
1319  else
1320  {
1321  return 0;
1322  }
1323  }
1324  else //pick random
1325  {
1326  //pick random from those available
1327  thissquare = random(score+1);
1328  best=q[index[thissquare]];
1329  }
1330  if (best==0) //roads or rivers/streams
1331  {
1332  //rivers are crossed 50:50. Roads depend on width and traffic load
1333  int cross=random(100);
1334  int hab=-2;
1335  int prob=50;
1336  int width=0;
1337  double mort=0;
1338  int xi = x+Vector_x[t[index[thissquare]]];
1339  int yi = y+Vector_y[t[index[thissquare]]];
1340  m_OurLandscape->CorrectCoords( xi, yi );
1341 
1342  if(m_OurLandscape->SupplyElementType( xi, yi )!=tole_River) //road
1343  { //get width of road
1344  width=m_OurLandscape->SupplyRoadWidth( xi, yi );
1345  prob=ProbRoadCross( xi, yi, width );
1346  //take mortality test
1347  mort=CalculateRoadMortality( xi, yi, width );
1348  }
1349  if (cross<prob) //yes, roe will cross
1350  {
1351  //does it survive?
1352  int die=random(100);
1353  if (die<mort)
1354  {
1355  return -1; //roe is dead
1356  }
1357  //Locate other side of the road. First in preferred direction and if
1358  //not found continue clockwise in all other directions
1359  int preferred=index[thissquare]; //preferred direction
1360  for (int k=0;k<8;k++) //in each direction
1361  {
1362  #ifdef JUJ__Debug2
1363  if(preferred>14)
1364  {
1365  m_OurLandscape ->Warn("Roe_Base:NextStep():Variable out of range, preferred","");
1366  exit( 1 );
1367  }
1368  #endif
1369  for(int j=1;j<20;j++)
1370  {
1371  hab=LegalHabitatCC( x+(Vector_x[t[preferred&7]]*j),
1372  y+(Vector_y[t[preferred&7]]*j) );
1373  if(hab>0) //other side found
1374  {
1375  //check 3 steps further on other side of road or stream.
1376  //If road or urban (check = -1) you can't cross
1377  check = LegalHabitatCC( x+(Vector_x[t[preferred&7]]*(j+3)),
1378  y+(Vector_y[t[preferred&7]]*(j+3)) );
1379  if(check>0) //OK
1380  {
1381  found=true;
1382  step=j; //need to walk this many steps to get across
1383  index[thissquare] = preferred & 7; //this direction
1384  }
1385  break;
1386  }
1387  }
1388  if(!found) preferred++;
1389 
1390  else break;
1391  }
1392  }
1393  if(!found) //would or could not cross
1394  { //score again, but don't include road or river
1395  score=-1;
1396  for (int j=0;j<d[weight];j++)
1397  {
1398  if (q[j]>0)
1399  {
1400  score++;
1401  index[score]=j;
1402  }
1403  }
1404  //pick random from those available
1405  thissquare = random(score+1);
1406  best=q[index[thissquare]];
1407  }
1408 
1409  if (score==-1) //no suitable options,
1410  {
1411  if((recurselevel==2) ||(NextStep(0,dir,++recurselevel)==-1)) //recursive function
1412  {
1413  return -1;
1414  }
1415  else
1416  {
1417  return 0;
1418  }
1419  }
1420  }
1421 
1422  // best way is now found, so check if you are crossing
1423  // into a new polygon?
1424  if (m_OurLandscape->
1425  SupplyPolyRefCC( x+Vector_x[t[index[thissquare]]],
1426  y+Vector_y[t[index[thissquare]]])
1427  != m_OurLandscape->SupplyPolyRefCC( x, y )) {
1430  }
1431  //change coordinates
1432  if(found) //roe is crossing a road or river
1433  {
1434  x+=(Vector_x[t[index[thissquare]]]*step);
1435  y+=(Vector_y[t[index[thissquare]]]*step);
1436  step=0;
1437  }
1438  else
1439  {
1440  x+=Vector_x[t[index[thissquare]]];
1441  y+=Vector_y[t[index[thissquare]]];
1442  }
1443  score=-1;
1444  found=false;
1445  }
1446  }
1447 
1448  //PART 2 don't need area correction
1449 
1450  else
1451  {
1452  //take 50 steps
1453  for(int i=0;i<50;i++)
1454  {
1455  q[0] = LegalHabitat(x+Vector_x[t[0]],y+Vector_y[t[0]]);
1456  q[1] = LegalHabitat (x+Vector_x[t[1]],y+Vector_y[t[1]]);
1457  q[2] = LegalHabitat (x+Vector_x[t[2]],y+Vector_y[t[2]]);
1458  q[3] = LegalHabitat (x+Vector_x[t[3]],y+Vector_y[t[3]]);
1459  q[4] = LegalHabitat (x+Vector_x[t[4]],y+Vector_y[t[4]]);
1460  q[5] = LegalHabitat (x+Vector_x[t[5]],y+Vector_y[t[5]]);
1461  q[6] = LegalHabitat (x+Vector_x[t[6]],y+Vector_y[t[6]]);
1462  q[7] = LegalHabitat (x+Vector_x[t[7]],y+Vector_y[t[7]]);
1463  //q[i]=-1,non-habitat, q[i]=0,road, q[i]=1 suitable
1464 
1465  for (int j=0; j<d[weight]; j++) //score as many squares as needed
1466  {
1467  if (q[j]>=0) //score only road or better
1468  {
1469  score++;
1470  index[score]=j;
1471  }
1472  }
1473  if (score==-1) //no suitable options,
1474  {
1475  if((recurselevel==2)||(NextStep(0,dir,++recurselevel)==-1))
1476  {
1477  return -1;
1478  }
1479  else
1480  {
1481  return 0;
1482  }
1483  }
1484  else
1485  {
1486  //pick random from those available
1487  thissquare = random(score+1);
1488  best=q[index[thissquare]];
1489  }
1490  if (best==0) //roads or rivers/streams
1491  {
1492  //rivers are crossed 50:50. Roads depend on width and traffic load
1493  int cross=random(100);
1494  int hab=-2;
1495  int prob=50;
1496  int width=0;
1497  double mort=0;
1498  int xi = x+Vector_x[t[index[thissquare]]];
1499  int yi = y+Vector_y[t[index[thissquare]]];
1500  if(m_OurLandscape->SupplyElementType( xi, yi )!=tole_River) //road
1501  { //get width of road
1502  width=m_OurLandscape->
1503  SupplyRoadWidth( xi, yi );
1504  prob=ProbRoadCross( xi, yi, width );
1505  //take mortality test
1506  mort=CalculateRoadMortality( xi, yi, width );
1507  }
1508  if (cross<prob) //yes, roe will cross
1509  {
1510  //does it survive?
1511  int die=random(100);
1512  if (die<mort)
1513  {
1514  return -1; //roe is dead
1515  }
1516  //Locate other side of the road. First in preferred direction and if
1517  //not found continue clockwise in all other directions
1518  int preferred=index[thissquare]; //preferred direction
1519  for (int k=0;k<8;k++) //in each direction
1520  {
1521  #ifdef JUJ__Debug2
1522  if(preferred>14)
1523  {
1524  m_OurLandscape ->Warn("Roe_Base:NextStep():Variable out of range, preferred","");
1525  exit( 1 );
1526  }
1527  #endif
1528  for(int j=1;j<20;j++)
1529  {
1530  hab=LegalHabitat((x+(Vector_x[t[preferred&7]]*j)),
1531  (y+(Vector_y[t[preferred&7]]*j)));
1532  if(hab>0) //other side found
1533  {
1534  //check 3 steps further on other side of road or stream.
1535  //If road or urban you can't cross
1536  check = LegalHabitat( x+(Vector_x[t[preferred&7]]*(j+3)),
1537  y+(Vector_y[t[preferred&7]]*(j+3)) );
1538 
1539  if(check>0) //OK
1540  {
1541  found=true;
1542  step=j; //need to walk this many steps to get across
1543  index[thissquare] = preferred & 7; //this direction
1544  }
1545  break;
1546  }
1547  }
1548  if(!found) preferred++;
1549  else break;
1550  }
1551  }
1552  if(!found) //would or could not cross
1553  { //score again, but don't include road or river
1554  score=-1;
1555  for (int j=0;j<d[weight];j++)
1556  {
1557  if (q[j]>0)
1558  {
1559  score++;
1560  index[score]=j;
1561  }
1562  }
1563  //pick random from those available
1564  thissquare = random(score+1);
1565  best=q[index[thissquare]];
1566  }
1567 
1568  if (score==-1) //no suitable options,
1569  {
1570  if((recurselevel==2)||(NextStep(0,dir,++recurselevel)==-1)) //recursive function
1571  {
1572  return -1;
1573  }
1574  else
1575  {
1576  return 0;
1577  }
1578  }
1579  }
1580 
1581  // best way is now found, so check if you are crossing
1582  // into a new polygon?
1583  if (m_OurLandscape->
1584  SupplyPolyRef(x+Vector_x[t[index[thissquare]]],
1585  y+Vector_y[t[index[thissquare]]])
1586  != m_OurLandscape->SupplyPolyRef(x,y))
1587  {
1588  m_Cross_x=x;
1589  m_Cross_y=y;
1590  }
1591  //change coordinates
1592  if(found==true) //roe is crossing a road
1593  {
1594  x+=(Vector_x[t[index[thissquare]]]*step);
1595  y+=(Vector_y[t[index[thissquare]]]*step);
1596  }
1597  else
1598  {
1599  x+=Vector_x[t[index[thissquare]]];
1600  y+=Vector_y[t[index[thissquare]]];
1601  }
1602  score=-1;
1603  found=false;
1604  } //end of 50 steps
1605  }
1606 
1607  //update roes location
1608  if(correct==true)
1609  {
1612  }
1613  else
1614  {
1615  m_Location_x = x;
1616  m_Location_y = y;
1617  }
1618  return 0;
1619 }
const int Vector_x[8]
const int Vector_y[8]
int SupplyPolyRefCC(int a_x, int a_y)
Definition: landscape.h:1500
int CorrectWidth(int x)
Definition: landscape.h:1567
int CorrectHeight(int y)
Definition: landscape.h:1573
int SupplyRoadWidth(int, int)
Definition: landscape.h:811
double CalculateRoadMortality(int p_x, int p_y, int p_width)
Definition: Roe_base.cpp:1093
int LegalHabitatCC(int p_x, int p_y)
Definition: Roe_all.h:172
unsigned IsAlive()
Definition: Roe_all.h:123
int ProbRoadCross(int p_x, int p_y, int p_width)
Definition: Roe_base.cpp:1075

References CalculateRoadMortality(), Landscape::CorrectCoords(), Landscape::CorrectHeight(), Landscape::CorrectWidth(), IsAlive(), LegalHabitat(), LegalHabitatCC(), m_Cross_x, m_Cross_y, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, ProbRoadCross(), random(), SimH, SimW, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyPolyRefCC(), Landscape::SupplyRoadWidth(), tole_River, Vector_x, Vector_y, and Landscape::Warn().

Referenced by Roe_Fawn::FAFeed(), Roe_Female::FDisperse(), Feeding(), Roe_Female::FEvade(), Roe_Male::MDisperse(), and Roe_Male::MEvade().

◆ NutriValue() [1/2]

int Roe_Base::NutriValue ( int  p_x,
int  p_y 
)
protected

Roe_Base::NutriValue - returns the amount of energy gained per 10 minutes in a particular polygon. Two switch statements; 1 for element type and 1 for crop type if field. Digestable energy content (DEC) is scaled to a monthly estimate of intake rate. Returns DEC value. calls functions SupplyElementType(), SupplyVegType(), SupplyVegBiomass().

Todo:
Decide on classification for new tole types for roe deer 1
531 {
532  //Nutrivalue returns the amount of energy gained per 10 minutes in this polygon.
533  //Two switch statements; 1 for element typse and 1 for crop type if field.
534  //Digestable energy content (DEC) is scaled to a monthly estimate of intake rate.
535 
536  int DEC = 0; //digestable energy content
537  double nutri = 0; //energy gain per minute
538  int day = m_OurLandscape->SupplyDayInYear();
540 
541  int month = m_OurLandscape->SupplyMonth();
542  if (Elem != tole_Field)
543  {
544  switch (Elem)//all but field returns value in this switch
545  {
546  case tole_Building:
547  case tole_Garden:
548  case tole_StoneWall:
549  case tole_Fence:
550  case tole_Pond:
551  case tole_Freshwater:
552  case tole_Saltwater:
553  case tole_River:
554  case tole_Coast:
555  case tole_ActivePit:
556  case tole_Railway:
557  case tole_LargeRoad:
558  case tole_SmallRoad:
559  case tole_Track:
560  case tole_Carpark:
561  case tole_UrbanNoVeg:
562  case tole_Stream:
563  case tole_AmenityGrass:
564  case tole_Saltmarsh:
565  case tole_Churchyard:
566  case tole_BareRock:
567  case tole_SandDune:
569  case tole_IndividualTree:
570  case tole_PlantNursery:
571  case tole_Vildtager:
572  case tole_WindTurbine:
574  case tole_WoodlandMargin:
575  case tole_Pylon:
576 
577  DEC = 0; //non habitats return 0
578  break;
579 
580  case tole_Marsh:
582  DEC = 950;
583  break;
584 
585  case tole_Heath:
586  case tole_RoadsideVerge:
587  case tole_RoadsideSlope:
588  case tole_PermPasture:
592  case tole_PitDisused:
596  case tole_FieldBoundary:
597  case tole_HeritageSite:
598  DEC = 1200;
599  break;
600 
601  case tole_Orchard:
603  case tole_MixedForest:
604  case tole_Scrub:
605  case tole_Hedges:
606  case tole_HedgeBank: // added by ljk on 13/7/2012
607  case tole_RiversideTrees:
608  case tole_Copse:
609  if ((day > 100) && (day < 270)) DEC = 1400;
610  else DEC = 950;
611  break;
612 
613  case tole_YoungForest: //new class 55
614  if ((day > 100) && (day < 270)) DEC = 1500;
615  else DEC = 950;
616  break;
617 
618  case tole_Foobar:
619  m_OurLandscape->Warn("Roe_Base::NutriValue(x,y): Unknown element type!", "tole_Foobar");
620  exit(1);
621  break;
622  default:
623  //throw an error
624  m_OurLandscape->Warn("Roe_Base::NutriValue(x,y): Unknown element type!", g_landscape_p->PolytypeToString(Elem));
625  exit(1);
626  break;
627  }
628  }
629  else //is field
630  {
631  //get crop type
632  TTypesOfVegetation VegType = m_OurLandscape->SupplyVegType(p_x, p_y);
633  double Biomass = ((double)m_OurLandscape->SupplyVegBiomass(p_x, p_y));
634  if (Biomass > 160) //ljk 31/7-2012, 160 - is this an arbitrary value?? Where does it come from? Is it just calibrated this way?
635  {
636  switch (VegType) //veg. or croptype as applicable
637  {
638  case tov_SpringBarley:
639  case tov_SpringBarleySpr:
640  case tov_Oats:
641  case tov_OOats:
643  case tov_OSpringBarley:
644  case tov_WinterBarley:
645  case tov_WinterWheat:
646  case tov_WinterRye:
647  case tov_OWinterBarley:
648  case tov_OWinterRye:
649  case tov_Triticale:
650  case tov_OTriticale:
651  case tov_OWinterWheat:
652 
653  case tov_Maize:
654  case tov_OMaizeSilage:
655  case tov_MaizeSilage:
656  case tov_MaizeStrigling:
657  DEC = 1200;
658  break;
659 
660  //seed- and permanent grass, same as natural grassy habitats
661  case tov_Setaside:
664  case tov_SeedGrass1:
665  case tov_SeedGrass2:
667  case tov_Heath:
668  DEC = 1100;
669  break;
670 
671  //undersown crops and clover grass
676  case tov_OSBarleySilage:
682  DEC = 1300;
683  break;
684 
685  //high quality crops
686  case tov_FieldPeas:
687  case tov_BroadBeans:
688  case tov_FodderBeet:
689  case tov_SugarBeet:
690  case tov_OFodderBeet:
691  case tov_OFieldPeas:
693  DEC = 1500;
694  break;
695 
696  //no-good crops
697  case tov_SpringRape:
698  case tov_WinterRape:
699  case tov_OWinterRape:
700  case tov_OGrazingPigs:
702  case tov_OCarrots:
703  case tov_Potatoes:
705  case tov_OPotatoes:
706  DEC = 100;
707  break;
708 
709  //others
710  case tov_None:
711  case tov_NoGrowth:
713  break;
714 
715  default:
716  m_OurLandscape->Warn("Roe_Base::NutriValue(x,y): Unknown vegetation type!", g_landscape_p->VegtypeToString(VegType));
717  exit(1);
718  break;
719  }
720  }
721  else DEC = 100;
722  }
723 
724  //DEC is multiplied by monthly estimate of intake rate
725  nutri = DEC * IntakeRate[month - 1];
726  return (int)nutri;
727 }
const float IntakeRate[12]
Definition: Roe_constants.cpp:56
std::string VegtypeToString(TTypesOfVegetation a_veg)
Definition: Landscape.cpp:4235
int SupplyDayInYear(void)
Definition: landscape.h:1596
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
int SupplyMonth(void)
Definition: landscape.h:1601
double SupplyVegBiomass(int a_polyref)
Definition: landscape.h:953
TTypesOfVegetation
Definition: tov_declaration.h:30
@ tov_OWinterWheatUndersown
Definition: tov_declaration.h:49
@ tov_BroadBeans
Definition: tov_declaration.h:66
@ tov_MaizeStrigling
Definition: tov_declaration.h:58
@ tov_PermanentGrassGrazed
Definition: tov_declaration.h:49
@ tov_OFieldPeas
Definition: tov_declaration.h:43
@ tov_OSpringBarleyPigs
Definition: tov_declaration.h:47
@ tov_PermanentSetaside
Definition: tov_declaration.h:49
@ tov_SeedGrass1
Definition: tov_declaration.h:50
@ tov_OGrazingPigs
Definition: tov_declaration.h:44
@ tov_NoGrowth
Definition: tov_declaration.h:38
@ tov_CloverGrassGrazed2
Definition: tov_declaration.h:33
@ tov_OSpringBarley
Definition: tov_declaration.h:46
@ tov_PotatoesIndustry
Definition: tov_declaration.h:50
@ tov_OFirstYearDanger
Definition: tov_declaration.h:44
@ tov_OWinterRape
Definition: tov_declaration.h:47
@ tov_OPotatoes
Definition: tov_declaration.h:44
@ tov_WinterRape
Definition: tov_declaration.h:53
@ tov_OPermanentGrassGrazed
Definition: tov_declaration.h:44
@ tov_SpringBarley
Definition: tov_declaration.h:52
@ tov_OWinterBarley
Definition: tov_declaration.h:47
@ tov_SpringBarleySilage
Definition: tov_declaration.h:52
@ tov_SpringBarleyCloverGrass
Definition: tov_declaration.h:52
@ tov_FieldPeas
Definition: tov_declaration.h:34
@ tov_OTriticale
Definition: tov_declaration.h:47
@ tov_OMaizeSilage
Definition: tov_declaration.h:65
@ tov_Triticale
Definition: tov_declaration.h:53
@ tov_OFodderBeet
Definition: tov_declaration.h:65
@ tov_WinterWheat
Definition: tov_declaration.h:55
@ tov_OCarrots
Definition: tov_declaration.h:43
@ tov_OSBarleySilage
Definition: tov_declaration.h:56
@ tov_SeedGrass2
Definition: tov_declaration.h:50
@ tov_OFieldPeasSilage
Definition: tov_declaration.h:56
@ tov_SugarBeet
Definition: tov_declaration.h:66
@ tov_CloverGrassGrazed1
Definition: tov_declaration.h:32
@ tov_SpringRape
Definition: tov_declaration.h:53
@ tov_SpringBarleySpr
Definition: tov_declaration.h:66
@ tov_Oats
Definition: tov_declaration.h:40
@ tov_MaizeSilage
Definition: tov_declaration.h:62
@ tov_OBarleyPeaCloverGrass
Definition: tov_declaration.h:41
@ tov_Maize
Definition: tov_declaration.h:36
@ tov_OCloverGrassSilage1
Definition: tov_declaration.h:43
@ tov_OCloverGrassGrazed2
Definition: tov_declaration.h:43
@ tov_Potatoes
Definition: tov_declaration.h:50
@ tov_None
Definition: tov_declaration.h:39
@ tov_Setaside
Definition: tov_declaration.h:50
@ tov_OWinterWheat
Definition: tov_declaration.h:66
@ tov_OWinterRye
Definition: tov_declaration.h:49
@ tov_OOats
Definition: tov_declaration.h:44
@ tov_Heath
Definition: tov_declaration.h:66
@ tov_OCloverGrassGrazed1
Definition: tov_declaration.h:43
@ tov_WinterRye
Definition: tov_declaration.h:55
@ tov_FodderBeet
Definition: tov_declaration.h:35
@ tov_SpringBarleyGrass
Definition: tov_declaration.h:52
@ tov_WinterBarley
Definition: tov_declaration.h:53

References g_landscape_p, IntakeRate, TAnimal::m_OurLandscape, Landscape::PolytypeToString(), Landscape::SupplyDayInYear(), Landscape::SupplyElementType(), Landscape::SupplyMonth(), Landscape::SupplyVegBiomass(), Landscape::SupplyVegType(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_Building, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Foobar, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MixedForest, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UrbanNoVeg, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, tov_BroadBeans, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FodderBeet, tov_Heath, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NoGrowth, tov_None, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OSBarleySilage, tov_OSpringBarley, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PermanentGrassGrazed, tov_PermanentSetaside, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyGrass, tov_SpringBarleySilage, tov_SpringBarleySpr, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, Landscape::VegtypeToString(), and Landscape::Warn().

◆ NutriValue() [2/2]

int Roe_Base::NutriValue ( int  polyref)
protected

◆ NutriValueCC()

int Roe_Base::NutriValueCC ( int  p_x,
int  p_y 
)
inlineprotected
197  {
198  m_OurLandscape->CorrectCoords( p_x, p_y );
199  return NutriValue( p_x, p_y );
200  }
int NutriValue(int polyref)

Referenced by SeekNutri().

◆ On_ChangeGroup()

virtual void Roe_Base::On_ChangeGroup ( int  )
inlinevirtual

Reimplemented in Roe_Fawn.

220 {}

Referenced by Roe_Female::FFormGroup().

◆ On_EndGroup()

virtual void Roe_Base::On_EndGroup ( )
inlinevirtual

Reimplemented in Roe_Female, and Roe_Fawn.

218 {}

◆ On_IsDead()

virtual void Roe_Base::On_IsDead ( Roe_Base ,
int  ,
bool   
)
inlinevirtual

Reimplemented in Roe_Male, Roe_Female, and Roe_Fawn.

217 {}

Referenced by Roe_Fawn::FADie(), and Roe_Female::FDie().

◆ On_MumAbandon()

virtual void Roe_Base::On_MumAbandon ( Roe_Female )
inlinevirtual

Reimplemented in Roe_Fawn.

216 {}

Referenced by Roe_Female::FUpdateEnergy().

◆ On_UpdateGroup()

virtual void Roe_Base::On_UpdateGroup ( int  ,
int   
)
inlinevirtual

Reimplemented in Roe_Female, and Roe_Fawn.

221 {}

◆ ProbRoadCross()

int Roe_Base::ProbRoadCross ( int  p_x,
int  p_y,
int  p_width 
)
protected

Roe_Base::ProbRoadCross - returns the probability of crossing road, depending on traffic load and road size (width). Calls function SupplyTrafficLoad().

1076 {
1077  double WidthIndex;
1078  double TrafficLoadIndex;
1079  double traffic=(double) m_OurLandscape->SupplyTrafficLoad(p_x,p_y);//absolute no. of cars/hr
1080  //scale width to largest roadtype to get value between 0 and 1
1081  WidthIndex=(double)p_width/MaxRoadWidth;
1082  //scale traffic to national max to get index between 0 and 1
1083  TrafficLoadIndex=(double)traffic/MaxTraffic;
1084  return (int)(100*(2+(((TrafficLoadIndex+1)+(WidthIndex+1))/-2)));
1085  //returns int between 0 and 100
1086 }
const int MaxTraffic
Definition: Roe_constants.cpp:66
const int MaxRoadWidth
Definition: Roe_constants.cpp:65

References TAnimal::m_OurLandscape, MaxRoadWidth, MaxTraffic, and Landscape::SupplyTrafficLoad().

Referenced by NextStep(), and WalkTo().

◆ Running()

bool Roe_Base::Running ( int  x,
int  y 
)
protected

Roe_Base::Running - straight line movement away from danger. Avoid water, buildings and gardens, but not roads. The Direction with highest total cover value is chosen. After 150 steps, the deer checks if this habitat is safe, and if cover is not good, the deer will keep running and check if safe every 25 m. Calls DirectionTo(), Cover(), SupplyRoadWidth(), CalculateRoadMortality().

381 {
382  //straight line movement away from danger. Avoid water, buildings and gardens,
383  //but not roads.
384 
385  int t[8];
386  int q[8];
387  q[5]=0;
388  q[6]=0;
389  q[7]=0;
390  bool IsSafe=false;
391  //get direction to threat
393 
394  //get cover in 3 directions from 0-50 m.
395  for (int i=0; i<50; i++)
396  {
397  t[5]=dir+3;
398  t[5]=(t[5]+8) & 7;
399  t[6]=dir-3;
400  t[6]=(t[6]+8) & 7;
401  t[7]=dir+4;
402  t[7]=(t[6]+8) & 7;
403  q[5]+=Cover(m_Location_x+Vector_x[t[5]], m_Location_y+Vector_y[t[5]]); //sums cover for each dir
404  q[6]+=Cover(m_Location_x+Vector_x[t[6]], m_Location_y+Vector_y[t[6]]);
405  q[7]+=Cover(m_Location_x+Vector_x[t[7]], m_Location_y+Vector_y[t[7]]);
406  }
407 //get direction with highest total cover value = int thisway
408  int max=q[5];
409  int thisway;
410 
411  if (q[6]>max) thisway=t[6];
412  else if (q[7]>max) thisway=t[7];
413  else thisway=t[5];
414 
415  for (int i=0; i<200; i++) //take 200 steps in that direction
416  { //make sure habitat is usable(Cover !=-1)
417  int rightway=0;
418  if (Cover(m_Location_x+Vector_x[thisway],m_Location_y+Vector_y[thisway])==-1) //thisway not possible, check +/- 1
419  {
420  //random pick between the other two directions
421  int pick = random(2);
422  if (pick==0)
423  { //try -1 first
424  if (Cover(m_Location_x+Vector_x[(thisway-1+8) & 0x07],
425  m_Location_y+Vector_y[(thisway-1+8) & 0x07])!=-1)
426  {
427  rightway=thisway-1;
428  }
429  else rightway=thisway+1;
430  }
431  else //try +1 first
432  {
433  if (Cover(m_Location_x+Vector_x[(thisway+1+8) & 0x07],
434  m_Location_y+Vector_y[(thisway+1+8) & 0x07])!=-1)
435  {
436  rightway=thisway+1;
437  }
438  else rightway=thisway-1;
439  }
440  }
441  //check if rightway is road
442  if (Cover(m_Location_x+Vector_x[rightway],
443  m_Location_y+Vector_y[rightway])==1)
444  {
445  //get width of road
446  int width=m_OurLandscape->SupplyRoadWidth(
447  m_Location_x+Vector_x[rightway],
448  m_Location_y+Vector_y[rightway]);
449 
450 
451  double mort=CalculateRoadMortality(
452  m_Location_x+Vector_x[rightway],
453  m_Location_y+Vector_y[rightway],width);
454  int rand=random(100);
455  //if(mort<rand) //roe dies
456  if(mort<(double)rand) //roe dies
457  {
458  m_IsDead=true;
459  }
460  }
461  //change coordinates
462  m_Location_x+= Vector_x[t[rightway]];
463  m_Location_y+= Vector_y[t[rightway]];
464  }
465 
466  //150 steps are taken, now check if this habitat is safe (cover>=2)
468  {
469  IsSafe=true;
470  }
471  else //cover not good, so keep running and check if safe every 25 m
472  {
473  int loop=0; //counts how many times through the for-loop, time's up after 6 (450 steps)
474  while ((IsSafe==false)&&(loop<=6))
475  {
476  for (int i=0; i<25; i++)
477  { //make sure habitat is usable(Cover !=-1)
478  int rightway=0;
479  if (Cover(m_Location_x+Vector_x[thisway],
480  m_Location_y+Vector_y[thisway])==-1)
481  //thisway not possible, check +/- 1
482  {
483  //random pick between the other two directions
484  int pick = random(2);
485  if (pick==0)
486  { //try -1 first
487  if (Cover(m_Location_x+Vector_x[(thisway-1+8) & 0x07],
488  m_Location_y+Vector_y[(thisway-1+8) & 0x07])!=-1)
489  {
490  rightway=thisway-1;
491  }
492  else rightway=thisway+1;
493  }
494  else //try +1 first
495  {
496  if (Cover(m_Location_x+Vector_x[(thisway+1+8) & 0x07],
497  m_Location_y+Vector_y[(thisway+1+8) & 0x07])!=-1)
498  {
499  rightway=thisway+1;
500  }
501  else rightway=thisway-1;
502  }
503  }
504  loop++;
505  //change coordinates and check if safe now
506  m_Location_x+= Vector_x[t[rightway]];
507  m_Location_y+= Vector_y[t[rightway]];
508 
510  {
511  IsSafe=true;
512  }
513  else IsSafe=false; //keep running in next time step
514  }
515  }
516  }
517  return IsSafe;
518 }

References CalculateRoadMortality(), Cover(), DirectionTo(), m_IsDead, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, random(), Landscape::SupplyRoadWidth(), Vector_x, and Vector_y.

Referenced by Roe_Female::FRun(), Roe_Male::MRun(), and Roe_Fawn::On_ApproachOfDanger().

◆ SeekCover()

void Roe_Base::SeekCover ( int  threshold)
protected

Roe_Base::SeekCover - Method for locating good spot based on cover. Used to find place to ruminate and fawn bedsites. Threshold is the minimum acceptable cover value Calls CoverCC(), WalkToCC(), Cover(), WalkTo().

45 {
46  int t[8];
47  int q[8];
48  int dir=random(8); //start looking in any direction
49  bool found=false;
50  bool correct=false;
51  t[0]=dir & 7;
52  t[1]=(dir+1) & 7;
53  t[2]=(dir+7) & 7;
54  t[3]=(dir+10) & 7;
55  t[4]=(dir+6) & 7;
56  t[5]=(dir+11) & 7;
57  t[6]=(dir+5) & 7;
58  t[7]=(dir+12) & 7;
59  int x=m_Location_x;
60  int y=m_Location_y;
61 
62  //need to correct coordinates
63  if((x <= 100)||(x >= SimW-100)||(y <= 100)||(y >= SimH-100))//could step out of area
64  {
65  correct=true;
66  x += SimW;
67  y += SimH;
68  for (int i=0; i< 100; i++) //up to 100 steps at a time
69  {
70  q[0]=CoverCC( x+(Vector_x[t[0]]*i), y+(Vector_y[t[0]]*i) );
71  q[1]=CoverCC( x+(Vector_x[t[1]]*i), y+(Vector_y[t[1]]*i) );
72  q[2]=CoverCC( x+(Vector_x[t[2]]*i), y+(Vector_y[t[2]]*i) );
73  q[3]=CoverCC( x+(Vector_x[t[3]]*i), y+(Vector_y[t[3]]*i) );
74  q[4]=CoverCC( x+(Vector_x[t[4]]*i), y+(Vector_y[t[4]]*i) );
75  q[5]=CoverCC( x+(Vector_x[t[5]]*i), y+(Vector_y[t[5]]*i) );
76  q[6]=CoverCC( x+(Vector_x[t[6]]*i), y+(Vector_y[t[6]]*i) );
77  q[7]=CoverCC( x+(Vector_x[t[7]]*i), y+(Vector_y[t[7]]*i) );
78  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
79  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
80  (q[6]>=threshold)||(q[7]>=threshold))
81  {
82  //which direction is it?
83  int thisway;
84  int score=-1;
85  int index[8];
86  for (int j=0; j<8; j++)
87  {
88  if (q[j]>=threshold)
89  {
90  score++; //this many suitable
91  index[score]=j;
92  }
93  }
94  int rand = random(score+1);
95  thisway=t[index[rand]];
96 
97  //walk to that place
98  WalkToCC( x+(Vector_x[thisway]*i), y+(Vector_y[thisway]*i) );
99  found=true;
100  break; //don't look any further
101  }
102  }
103  }
104  else //no need to correct area
105  {
106  for (int i=2; i< 100; i+=2) //up to 100 steps at a time
107  {
108  q[0]=Cover(x+(Vector_x[t[0]]*i),y+(Vector_y[t[0]]*i));
109  q[1]=Cover(x+(Vector_x[t[1]]*i),y+(Vector_y[t[1]]*i));
110  q[2]=Cover(x+(Vector_x[t[2]]*i),y+(Vector_y[t[2]]*i));
111  q[3]=Cover(x+(Vector_x[t[3]]*i),y+(Vector_y[t[3]]*i));
112  q[4]=Cover(x+(Vector_x[t[4]]*i),y+(Vector_y[t[4]]*i));
113  q[5]=Cover(x+(Vector_x[t[5]]*i),y+(Vector_y[t[5]]*i));
114  q[6]=Cover(x+(Vector_x[t[6]]*i),y+(Vector_y[t[6]]*i));
115  q[7]=Cover(x+(Vector_x[t[7]]*i),y+(Vector_y[t[7]]*i));
116  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
117  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
118  (q[6]>=threshold)||(q[7]>=threshold))
119  {
120  //which direction is it?
121  int thisway;
122  int score=-1;
123  int index[8];
124  for (int j=0; j<8; j++)
125  {
126  if (q[j]>=threshold)
127  {
128  score++; //this many suitable
129  index[score]=j;
130  }
131  }
132  int rand = random(score+1);
133  thisway=t[index[rand]];
134  //walk to that place
135  WalkTo(x+(Vector_x[thisway]*i),y+(Vector_y[thisway]*i));
136  found=true;
137  break; //don't look any further
138  }
139  }
140  }
141  if((!found)&&(!correct))//always need to correct now for this last bit
142  {
143  x+=SimW;
144  y+=SimH;
145  }
146  int i=100;
147  while(!found)
148  {
149  q[0]=CoverCC( x+(Vector_x[t[0]]*i), y+(Vector_y[t[0]]*i) );
150  q[1]=CoverCC( x+(Vector_x[t[1]]*i), y+(Vector_y[t[1]]*i) );
151  q[2]=CoverCC( x+(Vector_x[t[2]]*i), y+(Vector_y[t[2]]*i) );
152  q[3]=CoverCC( x+(Vector_x[t[3]]*i), y+(Vector_y[t[3]]*i) );
153  q[4]=CoverCC( x+(Vector_x[t[4]]*i), y+(Vector_y[t[4]]*i) );
154  q[5]=CoverCC( x+(Vector_x[t[5]]*i), y+(Vector_y[t[5]]*i) );
155  q[6]=CoverCC( x+(Vector_x[t[6]]*i), y+(Vector_y[t[6]]*i) );
156  q[7]=CoverCC( x+(Vector_x[t[7]]*i), y+(Vector_y[t[7]]*i) );
157  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
158  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
159  (q[6]>=threshold)||(q[7]>=threshold))
160  {
161  //which direction is it?
162  int thisway;
163  int score=-1;
164  int index[8];
165  for (int j=0; j<8; j++)
166  {
167  if (q[j]>=threshold)
168  {
169  score++; //this many suitable
170  index[score]=j;
171  }
172  }
173  int rand = random(score+1);
174  thisway=t[index[rand]];
175 
176  //walk to that place
177  WalkToCC( x+(Vector_x[thisway]*i), y+(Vector_y[thisway]*i) );
178  found=true;
179  break; //don't look any further
180  }
181  i+=2;
182  if(i>SimH)
183  {
184  m_OurLandscape ->Warn("Roe_Base:SeekCover():Variable out of range, i","");
185  exit( 1 );
186  }
187  }
188 }
void WalkTo(int pos_x, int pos_y)
Definition: Roe_base.cpp:1119
int CoverCC(int p_x, int p_y)
Definition: Roe_all.h:188
void WalkToCC(int pos_x, int pos_y)
Definition: Roe_all.h:209

References Cover(), CoverCC(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, random(), SimH, SimW, Vector_x, Vector_y, WalkTo(), WalkToCC(), and Landscape::Warn().

Referenced by Roe_Fawn::FARuminate(), Roe_Female::FRuminate(), Roe_Male::MRuminate(), and Roe_Fawn::SelectBedSite().

◆ SeekNutri()

void Roe_Base::SeekNutri ( int  threshold)
protected

Roe_Base::SeekNutri - locates good spot to feed based on Digestable energy content (DEC). Searches outwards in all directions for better quality. Equals 10 minutes of search activity. Calls NutriValueCC(), WalkToCC(), WalkTo(), NutriValue().

200 {
201  int dir=random(8); //start looking in any direction
202  int t[8];
203  int q[8];
204  t[0]=dir & 7;
205  t[1]=(dir+1) & 7;
206  t[2]=(dir+7) & 7;
207  t[3]=(dir+10) & 7;
208  t[4]=(dir+6) & 7;
209  t[5]=(dir+11) & 7;
210  t[6]=(dir+5) & 7;
211  t[7]=(dir+12) & 7;
212  //need to correct coordinates
213  int x=m_Location_x;
214  int y=m_Location_y;
215  bool found=false;
216  bool correct=false;
217 
218  if((x <= 100)||(x >= SimW-100)||(y <= 100)||(y >= SimH-100))//could step out of area
219  {
220  correct=true;
221  x += SimW;
222  y += SimH;
223  for (int i=2; i< 100; i+=2) //check up till 100 steps away
224  {
225  q[0]=NutriValueCC( x+(Vector_x[t[0]]*i), y+(Vector_y[t[0]]*i) );
226  q[1]=NutriValueCC( x+(Vector_x[t[1]]*i), y+(Vector_y[t[1]]*i) );
227  q[2]=NutriValueCC( x+(Vector_x[t[2]]*i), y+(Vector_y[t[2]]*i) );
228  q[3]=NutriValueCC( x+(Vector_x[t[3]]*i), y+(Vector_y[t[3]]*i) );
229  q[4]=NutriValueCC( x+(Vector_x[t[4]]*i), y+(Vector_y[t[4]]*i) );
230  q[5]=NutriValueCC( x+(Vector_x[t[5]]*i), y+(Vector_y[t[5]]*i) );
231  q[6]=NutriValueCC( x+(Vector_x[t[6]]*i), y+(Vector_y[t[6]]*i) );
232  q[7]=NutriValueCC( x+(Vector_x[t[7]]*i), y+(Vector_y[t[7]]*i) );
233  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
234  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
235  (q[6]>=threshold)||(q[7]>=threshold))
236  {
237  //which direction is it?
238  int thisway;
239  int score=-1;
240  int index[8];
241  int best = q[0];
242  for (int j=0; j<8; j++)
243  {
244  if (q[j]>best) //only 1 best choice
245  {
246  best = q[j];
247  score = 0;
248  index[score]=j;
249  }
250  else if (q[j]==best)
251  {
252  score++; //this many suitable
253  index[score]=j;
254  }
255  }
256  if (score==0)
257  {
258  thisway = t[index[score]];
259  }
260  else if (score >0)
261  {
262  int rand = random(score+1);
263  thisway=t[index[rand]];
264  }
265  //walk to that place
266  WalkToCC( x+(Vector_x[thisway]*i), y+(Vector_y[thisway]*i) );
267  found=true;
268  break; //don't look any further
269  }
270  }
271  }
272  else //no need to correct area
273  {
274  for (int i=2; i< 100; i+=2) //up till 200 steps at a time
275  {
276  q[0]=NutriValue(x+(Vector_x[t[0]]*i),y+(Vector_y[t[0]]*i));
277  q[1]=NutriValue(x+(Vector_x[t[1]]*i),y+(Vector_y[t[1]]*i));
278  q[2]=NutriValue(x+(Vector_x[t[2]]*i),y+(Vector_y[t[2]]*i));
279  q[3]=NutriValue(x+(Vector_x[t[3]]*i),y+(Vector_y[t[3]]*i));
280  q[4]=NutriValue(x+(Vector_x[t[4]]*i),y+(Vector_y[t[4]]*i));
281  q[5]=NutriValue(x+(Vector_x[t[5]]*i),y+(Vector_y[t[5]]*i));
282  q[6]=NutriValue(x+(Vector_x[t[6]]*i),y+(Vector_y[t[6]]*i));
283  q[7]=NutriValue(x+(Vector_x[t[7]]*i),y+(Vector_y[t[7]]*i));
284  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
285  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
286  (q[6]>=threshold)||(q[7]>=threshold))
287  {
288  //which direction is it?
289  int thisway;
290  int score=-1;
291  int index[8];
292  int best = q[0];
293  for (int j=0; j<8; j++)
294  {
295  if (q[j]>best) //only 1 best choice
296  {
297  best = q[j];
298  score = 0;
299  index[score]=j;
300  }
301  else if (q[j]==best)
302  {
303  score++; //this many suitable
304  index[score]=j;
305  }
306  }
307  if (score==0)
308  {
309  thisway = t[index[score]];
310  }
311  else if (score >0)
312  {
313  int rand = random(score+1);
314  thisway=t[index[rand]];
315  }
316  //walk to that place
317  WalkTo( x+(Vector_x[thisway]*i), y+(Vector_y[thisway]*i) );
318  found=true;
319  break; //don't look any further
320  }
321  }
322  }
323  if((!found)&&(!correct))//always need to correct now for this last bit
324  {
325  x+=SimW;
326  y+=SimH;
327  }
328  int i=100;
329  while(!found)
330  {
331  q[0]=NutriValueCC( x+(Vector_x[t[0]]*i), y+(Vector_y[t[0]]*i) );
332  q[1]=NutriValueCC( x+(Vector_x[t[1]]*i), y+(Vector_y[t[1]]*i) );
333  q[2]=NutriValueCC( x+(Vector_x[t[2]]*i), y+(Vector_y[t[2]]*i) );
334  q[3]=NutriValueCC( x+(Vector_x[t[3]]*i), y+(Vector_y[t[3]]*i) );
335  q[4]=NutriValueCC( x+(Vector_x[t[4]]*i), y+(Vector_y[t[4]]*i) );
336  q[5]=NutriValueCC( x+(Vector_x[t[5]]*i), y+(Vector_y[t[5]]*i) );
337  q[6]=NutriValueCC( x+(Vector_x[t[6]]*i), y+(Vector_y[t[6]]*i) );
338  q[7]=NutriValueCC( x+(Vector_x[t[7]]*i), y+(Vector_y[t[7]]*i) );
339  if ((q[0]>=threshold)||(q[1]>=threshold)||(q[2]>=threshold)||
340  (q[3]>=threshold)||(q[4]>=threshold)||(q[5]>=threshold)||
341  (q[6]>=threshold)||(q[7]>=threshold))
342  {
343  //which direction is it?
344  int thisway;
345  int score=-1;
346  int index[8];
347  for (int j=0; j<8; j++)
348  {
349  if (q[j]>=threshold)
350  {
351  score++; //this many suitable
352  index[score]=j;
353  }
354  }
355  int rand = random(score+1);
356  thisway=t[index[rand]];
357  //walk to that place
358  WalkToCC( x+(Vector_x[thisway]*i), y+(Vector_y[thisway]*i) );
359  found=true;
360  break; //don't look any further
361  }
362  i+=2;
363  if(i>SimH)
364  {
365  m_OurLandscape ->Warn("Roe_Base:SeekCover():Variable out of range, i","");
366  exit( 1 );
367  }
368  }
369 
370 }
int NutriValueCC(int p_x, int p_y)
Definition: Roe_all.h:196

References TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, NutriValue(), NutriValueCC(), random(), SimH, SimW, Vector_x, Vector_y, WalkTo(), WalkToCC(), and Landscape::Warn().

Referenced by Roe_Female::FFeed(), and Roe_Male::MFeed().

◆ Send_IsDead()

virtual void Roe_Base::Send_IsDead ( )
inlinevirtual
219 {}

◆ Step()

void Roe_Base::Step ( void  )
virtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from TAnimal.

Reimplemented in Roe_Male, Roe_Female, Roe_Fawn, and Roe_Adult_Base.

26 {
27  if (m_StepDone || (m_CurrentStateNo==-1)) return;
28 
29 }

References TALMaSSObject::m_CurrentStateNo, and TALMaSSObject::m_StepDone.

◆ SupplyInfo()

RoeDeerInfo Roe_Base::SupplyInfo ( )

Roe_Base::SupplyInfo - returns info on age, size, range center.

1669 {
1670  RoeDeerInfo RDI;
1671  RDI.m_Age = m_Age;
1672  RDI.m_Size = m_Size;
1673  RDI.m_Range_x = m_RangeCentre_x;
1674  RDI.m_Range_y = m_RangeCentre_y;
1675  RDI.m_OldRange_x = m_OldRange_x;
1676  RDI.m_OldRange_y = m_OldRange_y;
1677 
1678 
1679  return RDI;
1680 }
int m_Size
Definition: Roe_all.h:106
int m_Age
Definition: Roe_all.h:105
Part of the basic ALMaSS system (obselete)
Definition: PopulationManager.h:187
unsigned m_Range_y
Definition: PopulationManager.h:192
int m_Age
Definition: PopulationManager.h:190
unsigned m_Range_x
Definition: PopulationManager.h:191
unsigned m_OldRange_y
Definition: PopulationManager.h:194
unsigned m_OldRange_x
Definition: PopulationManager.h:193
int m_Size
Definition: PopulationManager.h:189

References RoeDeerInfo::m_Age, m_Age, RoeDeerInfo::m_OldRange_x, m_OldRange_x, RoeDeerInfo::m_OldRange_y, m_OldRange_y, RoeDeerInfo::m_Range_x, RoeDeerInfo::m_Range_y, m_RangeCentre_x, m_RangeCentre_y, RoeDeerInfo::m_Size, and m_Size.

Referenced by Roe_Fawn::FAInit(), Roe_Female::FFormGroup(), Roe_Male::MEstablishTerritory(), Roe_Male::On_IsDead(), Roe_Male::On_Rank(), RoeDeer_Population_Manager::SupplyFemaleRC(), RoeDeer_Population_Manager::SupplyMaleRC(), and RoeDeer_Population_Manager::UpdateRanges().

◆ SupplyReserves()

int Roe_Base::SupplyReserves ( )
inline
125 {return m_Reserves;}
int m_Reserves
Definition: Roe_all.h:109

◆ WalkTo()

void Roe_Base::WalkTo ( int  pos_x,
int  pos_y 
)
protected

Roe_Base::WalkTo - directed movement towards a position, all habitat except lethal habitat is used. Roads can be crossed, but mortality probability due to road crossing is calculated. Calls DirectionTo(), LegalHabitatCC(), CorrectCoords(), SupplyRoadWidth(), CalculateRoadMortality(), DirectionToCC().

1120 {
1121  //directed movement towards a position, all habitat except lethal
1122  //habitat is used. Roads can be crossed
1123  int t[8];
1124  int q[8];
1125  bool found=false;
1126  int x=m_Location_x+SimW;
1127  int y=m_Location_y+SimH;
1128  int step=0;
1129  //First get direction and distance to the position
1130  int dir=DirectionTo(m_Location_x,m_Location_y,pos_x,pos_y);
1131  int dist=DistanceTo(m_Location_x,m_Location_y,pos_x,pos_y);
1132  int range=4*dist;
1133  //Is it possible to go in preferred direction?
1134  for (int i=0; i<range; i++)
1135  {
1136  t[0]=(dir+8) & 7;
1137  q[0]=LegalHabitatCC( x+Vector_x[t[0]], y+Vector_y[t[0]] );
1138  if(q[0]>0) //good habitat
1139  {
1140  found=true;
1141  step=1;
1142  }
1143  else if(q[0]==0) //road, check if possible to cross
1144  {
1145  int check; //check habitat on other side of road
1146  int cross=random(100);
1147  //get width of road
1148  int xi = x+Vector_x[t[0]];
1149  int yi = y+Vector_y[t[0]];
1150  m_OurLandscape->CorrectCoords( xi, yi );
1151  int width=m_OurLandscape->SupplyRoadWidth( xi, yi );
1152  int prob=ProbRoadCross( xi, yi, width );
1153  if(prob<cross) //yes roe will cross
1154  {
1155  double mort=CalculateRoadMortality( xi, yi, width );
1156  int die=random(100);
1157  if (die<mort) //roe dies
1158  {
1159  m_IsDead=true;
1160  }
1161  else //survives
1162  { //locate the other side of road
1163  for(int j=1;j<20;j++) {
1164  int road=LegalHabitatCC( x+Vector_x[t[0]]*j, y+Vector_y[t[0]]*j);
1165  if(road!= 0) {
1166  //not road anymore
1167  //check 3 steps further on other side of road.
1168  //If road or urban you can't cross
1169  check = LegalHabitatCC( x+(Vector_x[t[0]]*(j+3)),
1170  y+(Vector_y[t[0]]*(j+3)) );
1171  if(check>1) //OK
1172  {
1173  found=true;
1174  step=j; //need to walk this many steps to get across
1175  }
1176  break;
1177  }
1178  }
1179  }
1180  }
1181  }
1182  if(found)
1183  {
1184  //change coordinates
1185  x +=(Vector_x[t[0]]*step);
1186  y +=(Vector_y[t[0]]*step);
1187  }
1188  else //unsuitable habitat or road that cannot be crossed
1189  {
1190  //check the remaining directions
1191  t[1]=(dir+7) & 7;
1192  t[2]=(dir+9) & 7;
1193  t[3]=(dir+6) & 7;
1194  t[4]=(dir+10) & 7;
1195  t[5]=(dir+11) & 7;
1196  t[6]=(dir+5) & 7;
1197  t[7]=(dir+12) & 7;
1198  q[1]=LegalHabitatCC( x+Vector_x[t[1]], y+Vector_y[t[1]] );
1199  q[2]=LegalHabitatCC( x+Vector_x[t[2]], y+Vector_y[t[2]] );
1200  q[3]=LegalHabitatCC( x+Vector_x[t[3]], y+Vector_y[t[3]] );
1201  q[4]=LegalHabitatCC( x+Vector_x[t[4]], y+Vector_y[t[4]] );
1202  q[5]=LegalHabitatCC( x+Vector_x[t[5]], y+Vector_y[t[5]] );
1203  q[6]=LegalHabitatCC( x+Vector_x[t[6]], y+Vector_y[t[6]] );
1204  q[7]=LegalHabitatCC( x+Vector_x[t[7]], y+Vector_y[t[7]] );
1205  //evaluate all directions
1206  for (int j=1; j<8;j++)
1207  {
1208  if(q[j]>0) //only evaluate better than road
1209  {
1210  found=true;
1211  step=1;
1212  //change coordinates
1213  x +=Vector_x[t[j]]*step;
1214  y +=Vector_y[t[j]]*step;
1215  break;
1216  }
1217  }
1218  }
1219  //check distance and direction now
1220  dir=DirectionToCC( x, y, pos_x, pos_y );
1221  dist=DistanceToCC( x, y, pos_x, pos_y );
1222  if (dist==0) break;
1223  }
1224  if(found)
1225  {
1226  //change roes position
1227  m_Location_x=x;
1228  m_Location_y=y;
1230  }
1231 }
int DirectionToCC(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_all.h:158
int DistanceToCC(int p_x, int p_y, int p_To_x, int p_To_y)
Definition: Roe_all.h:150

References CalculateRoadMortality(), Landscape::CorrectCoords(), DirectionTo(), DirectionToCC(), DistanceTo(), DistanceToCC(), LegalHabitatCC(), m_IsDead, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, ProbRoadCross(), random(), SimH, SimW, Landscape::SupplyRoadWidth(), Vector_x, and Vector_y.

Referenced by Roe_Fawn::FASuckle(), Roe_Male::MAttendFemale(), Roe_Male::On_InHeat(), SeekCover(), SeekNutri(), and Roe_Fawn::SelectBedSite().

◆ WalkToCC()

void Roe_Base::WalkToCC ( int  pos_x,
int  pos_y 
)
inlineprotected
210  {
211  m_OurLandscape->CorrectCoords( pos_x, pos_y );
212  WalkTo( pos_x, pos_y );
213  }

Referenced by SeekCover(), and SeekNutri().

◆ WhatState()

virtual int Roe_Base::WhatState ( )
inlinevirtual

Reimplemented from TAnimal.

226 {return (int) CurrentRState;}

Member Data Documentation

◆ Alive

unsigned Roe_Base::Alive

Referenced by Roe_Base(), and ~Roe_Base().

◆ CurrentRState

◆ m_Age

◆ m_Cross_x

int Roe_Base::m_Cross_x
protected

Referenced by NextStep(), and Roe_Base().

◆ m_Cross_y

int Roe_Base::m_Cross_y
protected

Referenced by NextStep(), and Roe_Base().

◆ m_danger_x

◆ m_danger_y

◆ m_Disperse

◆ m_distrc

int Roe_Base::m_distrc
protected

Referenced by Feeding().

◆ m_EnergyGained

◆ m_FeedCount

◆ m_FixlistNumber

◆ m_float

◆ m_HaveRange

◆ m_HomeRange

double Roe_Base::m_HomeRange

Referenced by Roe_Base().

◆ m_ID

int Roe_Base::m_ID

◆ m_IsDead

◆ m_LastState

◆ m_LengthFeedPeriod

◆ m_LengthRuminate

◆ m_OldRange_x

◆ m_OldRange_y

◆ m_OurPopulation

◆ m_RangeCentre_x

◆ m_RangeCentre_y

◆ m_RecovCount

◆ m_Reserves

◆ m_RumiCount

int Roe_Base::m_RumiCount
protected

◆ m_SearchRange

◆ m_Sex

◆ m_Size

◆ m_weightedstep

int Roe_Base::m_weightedstep
protected

◆ Mum

◆ SimH

◆ SimW

◆ timestep

int Roe_Base::timestep
protected

The documentation for this class was generated from the following files: